package cauca.scsn.modelo.entidad.id;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * EjeId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class EjeId implements java.io.Serializable {

	// Fields

	private Integer posicion;
	private Integer idEsquemaEje;

	// Constructors

	/** default constructor */
	public EjeId() {
	}

	/** full constructor */
	public EjeId(Integer posicion, Integer idEsquemaEje) {
		this.posicion = posicion;
		this.idEsquemaEje = idEsquemaEje;
	}

	// Property accessors

	@Column(name = "posicion", nullable = false)
	public Integer getPosicion() {
		return this.posicion;
	}

	public void setPosicion(Integer posicion) {
		this.posicion = posicion;
	}

	@Column(name = "id_esquema_eje", nullable = false)
	public Integer getIdEsquemaEje() {
		return this.idEsquemaEje;
	}

	public void setIdEsquemaEje(Integer idEsquemaEje) {
		this.idEsquemaEje = idEsquemaEje;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof EjeId))
			return false;
		EjeId castOther = (EjeId) other;

		return ((this.getPosicion() == castOther.getPosicion()) || (this
				.getPosicion() != null && castOther.getPosicion() != null && this
				.getPosicion().equals(castOther.getPosicion())))
				&& ((this.getIdEsquemaEje() == castOther.getIdEsquemaEje()) || (this
						.getIdEsquemaEje() != null
						&& castOther.getIdEsquemaEje() != null && this
						.getIdEsquemaEje().equals(castOther.getIdEsquemaEje())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getPosicion() == null ? 0 : this.getPosicion().hashCode());
		result = 37
				* result
				+ (getIdEsquemaEje() == null ? 0 : this.getIdEsquemaEje()
						.hashCode());
		return result;
	}

}